package com.example.springbootrabbitmq.receiver;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Service;

/**
 * @author ljw
 * @description
 * @date 2022/9/9 17:13
 */
@Service
public class Receiver {

    /**
     * 监听 RabbitMQ 的目的地发送的消息
     */
    @RabbitListener(queues = "my-queue")
    public void receiveMessage(String message) {
        System.out.println("接收到消息："+message);
    }
}
